import { createRouter, createWebHashHistory } from 'vue-router'
import { asyncMenu } from './router'

const routes = [
  {
    path: '/',
    name: 'Layout',
    redirect: '/databoard/data',
    component: () => import('@/view/Layout/index.vue'),
    meta: {
      hidden: true
    },
    children: asyncMenu
  },
  {
    path: '/404',
    name: 'Error',
    component: () => import('@/view/error/index.vue'),
    meta: {
      hidden: true
    }
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/view/login/index.vue'),
    meta: {
      hidden: true
    }
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
